//
//  detinationSecondTableViewCell.m
//  LT
//
//  Created by dllo on 16/5/18.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "detinationSecondTableViewCell.h"

@implementation detinationSecondTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}


-(void)createSubViews{
    
    self.cnnameLabel = [[UILabel alloc]init];
    self.cnnameLabel.textColor = [UIColor blackColor];
    self.cnnameLabel.backgroundColor = [UIColor clearColor];
    self.cnnameLabel.textAlignment = NSTextAlignmentLeft;
    self.cnnameLabel.font = [UIFont systemFontOfSize:19];
    [self.contentView addSubview:self.cnnameLabel];
    
    
    self.ennameLbel= [[UILabel alloc]init];
    self.ennameLbel.textColor = [UIColor blackColor];
    self.ennameLbel.backgroundColor = [UIColor clearColor];
    self.ennameLbel.textAlignment = NSTextAlignmentLeft;
    self.ennameLbel.font = [UIFont systemFontOfSize:19];
    [self.contentView addSubview:self.ennameLbel];
    
    self.lineLabel= [[UILabel alloc]init];
    self.lineLabel.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.lineLabel];
    
}

-(void)layoutSubviews{
    [super layoutSubviews];
   
     self.cnnameLabel.frame = CGRectMake(0 * WIDTHCELL, 0 * WIDTHCELL, 150 * WIDTHCELL, (self.frame.size.height-10));
     self.ennameLbel.frame = CGRectMake(150 * WIDTHCELL, 0 * WIDTHCELL, (self.frame.size.width - 50), (self.frame.size.height-10));
    self.lineLabel.frame = CGRectMake(0* WIDTHCELL, (self.frame.size.height-10), self.frame.size.width , 1* WIDTHCELL);
}


//setter方法赋值
-(void)setCountryModel:(DescountryModel *)countryModel{
    
    _countryModel = countryModel;
    
    //cnnameLable的文字 等于 model中的文字
    self.cnnameLabel.text = _countryModel.cnname;
    self.ennameLbel.text = _countryModel.enname;
        
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
